package com.ishansong.ticket.service.impl;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.ishansong.ticket.exception.ServiceDaoException;
import com.ishansong.ticket.exception.ServiceException;
import com.ishansong.ticket.model.${mo};
import com.ishansong.ticket.service.${mo}Service;
import com.matrixjoy.dal.id.util.SequenceService;

 
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:/application-context.xml"})
public class ${mo}ServiceTest extends AbstractJUnit4SpringContextTests{

	@Autowired
	${mo}Service ${mop}Service;
	
	@Test
	public void testSave() throws ServiceDaoException, ServiceException {
		
		${mo} ${mop} = new ${mo}();
		
		Long id = ${mop}Service.save${mo}(${mop});
		
		${mop} = ${mop}Service.get${mo}(id);
		
		${mop}Service.update${mo}(${mop});
		
		${mop}Service.delete${mo}(id);
		
		System.out.println(id);
	}
	
}
  